#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <math.h>
#include <unistd.h>

int main(void){
	unsigned long long x = 0x12345678aabbccdd;
	//__asm__("int3;");
	printf("%Lf\n",sqrtl(x));

	int size = 100000000;
	//in linux with -D_BSD_SOURCE
	//char *buf = mmap(NULL,size,PROT_READ|PROT_WRITE,MAP_SHARED|MAP_ANONYMOUS,-1,0);
	//in mac os x
	char *buf = mmap(NULL,size,PROT_READ|PROT_WRITE,MAP_SHARED|MAP_ANON,-1,0);
	
	printf("errno 22 is %s\n",strerror(22));
	if(buf == MAP_FAILED){
		printf("mmap failed(%s)\n",strerror(errno));
		return 1;
	}

	//printf("%08x %08x\n",PROT_WRITE|PROT_READ,MAP_SHARED|MAP_ANONYMOUS);
	printf("%08x %08x\n",PROT_WRITE|PROT_READ,MAP_SHARED|MAP_ANON);

	printf("%08x\n",MAP_SHARED);  
	munmap(buf,size);
	return 0;
}
